﻿
using System;
namespace ServerFramework.Tools
{
    /// <summary>
    /// 游戏服务器入口
    /// </summary>
    public class ServerStart
    {
        /// <summary>
        /// 启动
        /// </summary>
        public virtual void Start(string[] args)
        {

        }

        /// <summary>
        /// update 输入 close 关闭服务器
        /// </summary>
        public virtual void Update()
        {
            bool isRun = true;
            while (isRun)
            {
                var line = Console.ReadLine();
                if (line != null && line.Equals("close"))
                {
                    isRun = false;
                }
				System.Threading.Thread.Sleep(20);
            }
        }

        /// <summary>
        /// 游戏服结束
        /// </summary>
        public virtual void Stop()
        {

        }
    }
}
